<!DOCTYPE html>

<html>

<head>
    <meta charset="utf-8">
    <title>学员控制台主页一</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
</head>

<body>
    <script src="../../layuiadmin/jquery/echarts.min.js"></script>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-row layui-col-space15">


                    <div class="layui-col-md12">
                        <div class="layui-card">
                            <div class="layui-card-header">学员概览</div>
                            <div id="studentList" style="height:350px"></div>
                        </div>
                    </div>
                    <div class="layui-col-md12">
                        <div class="layui-card">
                            <div class="layui-card-header">非学员概览</div>
                            <div id="nostudentList" style="height:350px"></div>
                        </div>
                    </div>

                </div>
            </div>

            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">学员信息</div>
                    <div class="layui-carousel layadmin-carousel layadmin-backlog">
                        <div carousel-item>
                            <ul class="layui-row layui-col-space12">
                                <li class="layui-col-xs4">
                                    <a class="layadmin-backlog-body">
                                        <h3>学员总数</h3>
                                        <p><cite id="studentTotal"> </cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-xs4">
                                    <a class="layadmin-backlog-body">
                                        <h3>今年学员</h3>
                                        <p><cite id="studentYearCount"> </cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-xs4">
                                    <a class="layadmin-backlog-body">
                                        <h3>本月学员</h3>
                                        <p><cite id="studentMethodCount"></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-xs4">
                                    <a href="javascript:;" class="layadmin-backlog-body">
                                        <h3>本周学员</h3>
                                        <p><cite id="studentWeekCount"></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-xs4">
                                    <a href="javascript:;" class="layadmin-backlog-body">
                                        <h3>今日学员</h3>
                                        <p><cite id="studentDayCount"></cite></p>
                                    </a>
                                </li>
                            </ul>

                        </div>
                    </div>
                    <div class="layui-card">
                        <div class="layui-card-header">非学员信息</div>
                        <div class="layui-carousel layadmin-carousel layadmin-backlog">
                            <div carousel-item>
                                <ul class="layui-row layui-col-space12">
                                    <li class="layui-col-xs4">
                                        <a class="layadmin-backlog-body">
                                            <h3>学员总数</h3>
                                            <p><cite id="nostudentTotal"> </cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs4">
                                        <a class="layadmin-backlog-body">
                                            <h3>今年学员</h3>
                                            <p><cite id="nostudentYearCount"> </cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs4">
                                        <a class="layadmin-backlog-body">
                                            <h3>本月学员</h3>
                                            <p><cite id="nostudentMethodCount"></cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs4">
                                        <a href="javascript:;" class="layadmin-backlog-body">
                                            <h3>本周学员</h3>
                                            <p><cite id="nostudentWeekCount"></cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs4">
                                        <a href="javascript:;" class="layadmin-backlog-body">
                                            <h3>今日学员</h3>
                                            <p><cite id="nostudentDayCount"></cite></p>
                                        </a>
                                    </li>
                                </ul>

                            </div>
                        </div>

                        <!---->

                    </div>



                    <!--       <div class="layui-card">
                    <div class="layui-card-header">产品动态</div>
                    <div class="layui-card-body">
                        <div class="layui-carousel layadmin-carousel layadmin-news" data-autoplay="true" data-anim="fade" lay-filter="news">
                            <div carousel-item>
                                <div><a href="" target="_blank" class="layui-bg-red">layuiAdmin 快速上手文档</a></div>
                                <div><a href="" target="_blank" class="layui-bg-green">layuiAdmin 会员讨论专区</a></div>
                                <div><a href="" target="_blank" class="layui-bg-blue">获得 layui 官方后台模板系统</a></div>
                            </div>
                        </div>
                    </div>
                </div> -->

                    <!--        <div class="layui-card">
                    <div class="layui-card-header">
                        作者心语
                        <i class="layui-icon layui-icon-tips" lay-tips="要支持的噢" lay-offset="5"></i>
                    </div>
                    <div class="layui-card-body layui-text layadmin-text">
                        <p>一直以来，layui 发者产品本身的缺口。</p>

                        <p>—— 贤心（<a href=" " target="_blank">layui.com</a>）</p>
                    </div>
                </div> -->
                </div>

            </div>
        </div>
        <script src="../../layuiadmin/url.js"></script>
        <script src="../../layuiadmin/jquery/jquery-1.11.1.min.js"></script>
        <script src="../../layuiadmin/layui/layui.js?t=1"></script>
        <script>
            layui.config({
                base: '../../layuiadmin/' //静态资源所在路径
            }).extend({
                index: 'lib/index' //主入口模块
            }).use(['index', 'console']);
        </script>
        <script>
            $(function() {
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: applicationUrl + 'student/api/count',
                    success: function(result) {
                        $("#studentTotal").text(result.data.total);
                        $("#studentYearCount").text(result.data.yearsCount);
                        $("#studentMethodCount").text(result.data.nowMethod);
                        $("#studentWeekCount").text(result.data.nowWeek);
                        $("#studentDayCount").text(result.data.nowDay);
                    }
                });
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: applicationUrl + 'no-student/api/count',
                    success: function(result) {
                        $("#nostudentTotal").text(result.data.total);
                        $("#nostudentYearCount").text(result.data.yearsCount);
                        $("#nostudentMethodCount").text(result.data.nowMethod);
                        $("#nostudentWeekCount").text(result.data.nowWeek);
                        $("#nostudentDayCount").text(result.data.nowDay);
                    }
                });
            });
        </script>
        <script type="text/javascript">
            var dom = document.getElementById("studentList");
            var myChart = echarts.init(dom);
            var app = {};

            var option;
            var count = {};
            var Datetime = {};
            $.ajax({
                type: "GET",
                dataType: "json",
                url: applicationUrl + 'student/api/get/echarts',
                success: function(result) {
                    this.count = result.count;
                    this.Datetime = result.date;
                    console.log(result.count);
                    console.log(result.date);
                    option = {
                        title: {
                            text: '学员概览'
                        },
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                            data: ['学员增长趋势图']
                        },
                        grid: {
                            left: '3%',
                            right: '4%',
                            bottom: '3%',
                            containLabel: true
                        },
                        toolbox: {
                            feature: {
                                saveAsImage: {}
                            }
                        },
                        xAxis: {
                            type: 'category',
                            boundaryGap: false,
                            data: result.date
                        },
                        yAxis: {
                            type: 'value'
                        },
                        series: [{
                            name: '学员增长',
                            type: 'line',
                            stack: '总量',
                            data: result.count
                        }]
                    };

                    if (option && typeof option === 'object') {
                        myChart.setOption(option);
                    }
                }
            });


            var dom = document.getElementById("nostudentList");
            var myChart2 = echarts.init(dom);
            var app = {};
            $.ajax({
                type: "GET",
                dataType: "json",
                url: applicationUrl + 'no-student/api/get/echarts',
                success: function(result) {
                    this.count = result.count;
                    this.Datetime = result.date;
                    console.log(result.count);
                    console.log(result.date);
                    option = {
                        title: {
                            text: '非学员概览'
                        },
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                            data: ['非学员增长趋势图']
                        },
                        grid: {
                            left: '3%',
                            right: '4%',
                            bottom: '3%',
                            containLabel: true
                        },
                        toolbox: {
                            feature: {
                                saveAsImage: {}
                            }
                        },
                        xAxis: {
                            type: 'category',
                            boundaryGap: false,
                            data: result.date
                        },
                        yAxis: {
                            type: 'value'
                        },
                        series: [{
                            name: '非学员增长',
                            type: 'line',
                            stack: '总量',
                            data: result.count
                        }]
                    };

                    if (option && typeof option === 'object') {
                        myChart2.setOption(option);
                    }
                }
            });
        </script>

</body>

</html>